<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/pintuer.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/admin.css">
  <script type="text/javascript" src="${pageContext.request.contextPath}/${pageContext.request.contextPath}/static/js/jquery-1.12.4.js"></script>
  <script src="${pageContext.request.contextPath}/static/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 用户管理</strong></div>
    <div class="padding border-bottom">
      <ul class="search">
        <li>
          <button type="button"  class="button border-green" id="checkall"><span class="icon-check"></span> 全选</button>
          <button type="submit" class="button border-red"><span class="icon-trash-o"></span> 批量删除</button>
        </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="120">编号</th>
        <th>姓名</th>       
        <th>电话</th>
        <th>邮箱</th>
        <th>地址</th>
        <th>操作</th>       
      </tr>
      <c:forEach var="ss" items="${page.rows}">
        <tr>
          <td><%--<input type="checkbox" name="id[]" value="1" />--%>
            ${ss.uid}</td>
          <td> ${ss.uname}</td>
          <td> ${ss.uphone}</td>
          <td> ${ss.uemail}</td>
          <td> ${ss.uaddress}</td>

          <td><div class="button-group"> <a  class="button border-red" onclick="return del('${ss.uid}')"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
      </c:forEach>

       <%-- <tr>
          <td><input type="checkbox" name="id[]" value="1" />
            1</td>
          <td>神夜</td>
          <td>13420925611</td>
          <td>564379992@qq.com</td>  
           <td>深圳市民治街道</td>         

          <td><div class="button-group"> <a class="button border-red" href="javascript:void(0)" onclick="return del(1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
          <tr>
          <td><input type="checkbox" name="id[]" value="1" />
            1</td>
          <td>神夜</td>
          <td>13420925611</td>
          <td>564379992@qq.com</td>  
           <td>深圳市民治街道</td>         

          <td><div class="button-group"> <a class="button border-red" href="javascript:void(0)" onclick="return del(1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
          <tr>
          <td><input type="checkbox" name="id[]" value="1" />
            1</td>
          <td>神夜</td>
          <td>13420925611</td>
          <td>564379992@qq.com</td>  
           <td>深圳市民治街道</td>         

          <td><div class="button-group"> <a class="button border-red" href="javascript:void(0)" onclick="return del(1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
          <tr>
          <td><input type="checkbox" name="id[]" value="1" />
            1</td>
          <td>神夜</td>
          <td>13420925611</td>
          <td>564379992@qq.com</td>  
           <td>深圳市民治街道</td>--%>
<%--
          <td><div class="button-group"> <a class="button border-red" href="javascript:void(0)" onclick="return del(1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>--%>

      <tr>
        <td colspan="8"><div class="pagelist">
          <a href="${pageContext.request.contextPath}/friend/book?curPage=${page.curPage-1}">上一页</a>
          <c:forEach begin="1" end="${page.pageCount}" var="p">
            <a href="${pageContext.request.contextPath}/friend/book?curPage=${p}"
                    <c:if test="${page.curPage==p}">
                      class="current"</c:if> >
                ${p}
            </a>
            </c:forEach>
          <a href="${pageContext.request.contextPath}/friend/book?curPage=${page.curPage+1}">下一页</a>
          </div></td>
        <%--<span class="current">1</span>
        <a href="">2</a>
        <a href="">3</a>--%>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">

$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

function del(id) {
    alert(id);
    var t=confirm("您确认要删除选中的内容吗？");
    if (t==false) return false;
    location.href="del?uid="+id;
}

function DelSelect(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false; 		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

</script>
</body></html>